package com.dinzeer.sjapadder;

import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.config.ModConfigEvent;

@Mod.EventBusSubscriber(modid = Sjap_adder.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class Config
{
    private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();

    private static final ForgeConfigSpec.IntValue COUNT_BURNNING_DANCE_JUDGEMENT_CUT = BUILDER
            .comment("Count of Judgement cuts summoned by the SA Burning Dance.")
            .defineInRange("countBurningDanceJudgementCut", 12, 0, Integer.MAX_VALUE);

    private static final ForgeConfigSpec.IntValue COUNT_DARK_CUT_JUDGEMENT_CUT = BUILDER
            .comment("Count of Judgement cuts summoned by the SA Dark Cut.")
            .defineInRange("countDarkCutJudgementCut", 25, 0, Integer.MAX_VALUE);

    private static final ForgeConfigSpec.IntValue COUNT_DARK_CUT_JUDGEMENT_CUT_EX = BUILDER
            .comment("Count of Judgement-Cut-EXs summoned by the SA Dark Cut.")
            .defineInRange("countDarkCutJudgementCutEx", 25, 0, Integer.MAX_VALUE);

    public static final ForgeConfigSpec.DoubleValue DRIVE_SUM_RATIO = BUILDER
            .comment("The damage ratio of DriveSum")
            .defineInRange("driveSumRatio", 7.5, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue DRIVE_SUM_QUEEN_RATIO = BUILDER
            .comment("The damage ratio of Queen Slash of DriveSum")
            .defineInRange("driveSumQueenRatio", 14, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue SHADOW_OF_REVENANT_RATIO = BUILDER
            .comment("The damage ratio of Shadow of Revenant")
            .defineInRange("shadowOfRevenantRatio", 0.35, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue EXPLOSIVE_DAWN_MAIN_RATIO = BUILDER
            .comment("The main damage ratio of Explosive Dawn")
            .defineInRange("explosiveDawnMainRatio", 5.0, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue EXPLOSIVE_DAWN_BIG_EXPLOSION_RATIO = BUILDER
            .comment("The big explosion damage ratio of Explosive Dawn")
            .defineInRange("explosiveDawnBigExplosionRatio", 1.0, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue EXPLOSIVE_DAWN_SMALL_EXPLOSION_RATIO = BUILDER
            .comment("The small explosion damage ratio of Explosive Dawn")
            .defineInRange("explosiveDawnSmallExplosionRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue FIRE_DANCE_JUDGEMENT_CUT_DAMAGE = BUILDER
            .comment("The damage dealt by Judgement Cut of Fire Dance")
            .defineInRange("fireDanceJudgementCutDamage", 10, 0, Double.MAX_VALUE);

    public static final ForgeConfigSpec.DoubleValue FIRE_DANCE_CIRCLE_SLASH_DAMAGE = BUILDER
            .comment("The damage dealt by Circle Drive of Fire Dance")
            .defineInRange("fireDanceCircleSlashDamage", 0.3, 0, Double.MAX_VALUE);

    private static final ForgeConfigSpec.IntValue COUNT_NIGHTINGALES_SLASH = BUILDER
            .comment("Count of Slash of the SA Nightingales.")
            .defineInRange("countNightingalesSlash", 20, 0, Integer.MAX_VALUE);
    private static final ForgeConfigSpec.IntValue COUNT_SUPER_BLOOD_CUT = BUILDER
            .comment("Count of Judgement Cuts of the SA SuperBloodCut.")
            .defineInRange("countSuperBloodCut", 25, 0, Integer.MAX_VALUE);
    private static final ForgeConfigSpec.IntValue COUNT_WAVE_EDGE_SUPER_BASE = BUILDER
            .comment("Base count of Slash (before boosted by BoostTrigger) of the SA Wave Edge Super.")
            .defineInRange("countWaveEdgeSuperBase", 25, 0, Integer.MAX_VALUE);
    private static final ForgeConfigSpec.IntValue COST_WAVE_EDGE_SUPER_BOOST = BUILDER
            .comment("Cost this many BoostTrigger and increase the same count of Slash dealt by the SA Wave Edge Super.\nSet to 0 will disable the boosting.")
            .defineInRange("costWaveEdgeSuperBoost", 8, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.DoubleValue WAVE_EDGE_SUPER_DRIVE_DAMAGE = BUILDER
            .comment("The damage dealt by Circle Drive of Wave Edge Super.")
            .defineInRange("waveEdgeSuperDriveDamage", 10, 0, Double.MAX_VALUE);
    public static final ForgeConfigSpec.DoubleValue XROSS_THUNDER_DAMAGE = BUILDER
            .comment("The damage of XrossThunder.")
            .defineInRange("xrossThunderDamage", 4, 0, Double.MAX_VALUE);

    public static final ForgeConfigSpec.DoubleValue FIRE_DANCE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of FireDance")
            .defineInRange("fireDanceComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue BURNING_DANCE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of BurningDance")
            .defineInRange("burningDanceComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue COLD_DRIVE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of ColdDrive")
            .defineInRange("coldDriveComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue SAKURA_WAVE_EDGE_LEFT_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of SakuraWaveEdgeLeft")
            .defineInRange("sakuraWaveEdgeLeftComboRatio", 1.2, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue SAKURA_WAVE_EDGE_RIGHT_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of SakuraWaveEdgeRight")
            .defineInRange("sakuraWaveEdgeRightComboRatio", 1.5, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue TERRIFYING_WAVES_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of TerrifyingWaves")
            .defineInRange("terrifyingWavesComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue LIGHTING_SWORDSEX_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of LightingSwordsex")
            .defineInRange("lightingSwordsexComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue FOR_LIFE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of ForLife")
            .defineInRange("forLifeComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue FOR_LIFE_DIVE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of ForLifeDive")
            .defineInRange("forLifeDiveComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue ILLUSION_DRIVE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of IllusionDrive")
            .defineInRange("illusionDriveComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue RAINBOW_DRIVE_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of RainbowDrive")
            .defineInRange("rainbowDriveComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue WAVE_EDGE_SUPER_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of WaveEdgeSuper")
            .defineInRange("waveEdgeSuperComboRatio", 0.1, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue SAKURA_DRIVE_LEFT_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of SakuraDriveLeft")
            .defineInRange("sakuraDriveLeftComboRatio", 1.2, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue SAKURA_DRIVE_RIGHT_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of SakuraDriveRight")
            .defineInRange("sakuraDriveRightComboRatio", 1.5, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue XROSS_THUNDER_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of XrossThunder")
            .defineInRange("xrossThunderComboRatio", 1.2, 0, 100.0);

    public static final ForgeConfigSpec.DoubleValue XROSS_THUNDER2_COMBO_RATIO = BUILDER
            .comment("The Combo Ratio of XrossThunder2")
            .defineInRange("xrossThunder2ComboRatio", 1.5, 0, 100.0);

    public static final ForgeConfigSpec.IntValue COLD_GUARDIAN_MAX_STACK = BUILDER
            .comment("Stack maximum of ColdGuardian")
            .defineInRange("coldGuardianMaxStack", 300, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.IntValue BOOST_TRIGGER_MAX_STACK = BUILDER
            .comment("Stack maximum of BoostTrigger")
            .defineInRange("boostTriggerMaxStack", 8, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.IntValue CLEAR_MIND_CD_MAX_STACK = BUILDER
            .comment("Stack maximum of ClearMindCd")
            .defineInRange("clearMindCdMaxStack", 20*60*3, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.IntValue BLUE_DREAM_COMBO_MAX_STACK = BUILDER
            .comment("Stack maximum of BlueDreamCombo")
            .defineInRange("blueDreamComboMaxStack", 6, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.IntValue BLUE_DREAM_CHARGER_MAX_STACK = BUILDER
            .comment("Stack maximum of BlueDreamCharger")
            .defineInRange("blueDreamChargerMaxStack", 4, 0, Integer.MAX_VALUE);
    public static final ForgeConfigSpec.IntValue BLUE_DREAM_CHARGER_SUPER_MAX_STACK = BUILDER
            .comment("Stack maximum of BlueDreamChargerSuper")
            .defineInRange("blueDreamChargerSuperMaxStack", 2, 0, Integer.MAX_VALUE);

    static final ForgeConfigSpec SPEC = BUILDER.build();


    public static int countBurningDanceJudgementCut;
    public static int countDarkCutJudgementCut;
    public static int countDarkCutJudgementCutEx;
    public static float driveSumRatio;
    public static float driveSumQueenRatio;
    public static float shadowOfRevenantRatio;
    public static float explosiveDawnMainRatio;
    public static float explosiveDawnBigExplosionRatio;
    public static float explosiveDawnSmallExplosionRatio;
    public static float fireDanceJudgementCutDamage;
    public static float fireDanceCircleSlashDamage;
    public static int countNightingalesSlash;
    public static int countSuperBloodCut;
    public static int countWaveEdgeSuperBase;
    public static int costWaveEdgeSuperBoost;
    public static float waveEdgeSuperDriveDamage;
    public static float xrossThunderDamage;
    public static double fireDanceComboRatio;
    public static double burningDanceComboRatio;
    public static double coldDriveComboRatio;
    public static double sakuraWaveEdgeLeftComboRatio;
    public static double sakuraWaveEdgeRightComboRatio;
    public static double terrifyingWavesComboRatio;
    public static double lightingSwordsExComboRatio;
    public static double forLifeComboRatio;
    public static double forLifeDiveComboRatio;
    public static double illusionDriveComboRatio;
    public static double rainbowDriveComboRatio;
    public static double waveEdgeSuperComboRatio;
    public static double sakuraDriveLeftComboRatio;
    public static double sakuraDriveRightComboRatio;
    public static double xrossThunderComboRatio;
    public static double xrossThunder2ComboRatio;
    public static int coldGuardianMaxStack;
    public static int boostTriggerMaxStack;
    public static int clearMindCdMaxStack;
    public static int blueDreamComboMaxStack;
    public static int blueDreamChargerMaxStack;
    public static int blueDreamChargerSuperMaxStack;


    @SubscribeEvent
    static void onLoad(final ModConfigEvent event)
    {
        countBurningDanceJudgementCut = COUNT_BURNNING_DANCE_JUDGEMENT_CUT.get();
        countDarkCutJudgementCut = COUNT_DARK_CUT_JUDGEMENT_CUT.get();
        countDarkCutJudgementCutEx = COUNT_DARK_CUT_JUDGEMENT_CUT_EX.get();
        driveSumRatio = DRIVE_SUM_RATIO.get().floatValue();
        driveSumQueenRatio = DRIVE_SUM_QUEEN_RATIO.get().floatValue();
        shadowOfRevenantRatio = SHADOW_OF_REVENANT_RATIO.get().floatValue();
        explosiveDawnMainRatio = EXPLOSIVE_DAWN_MAIN_RATIO.get().floatValue();
        explosiveDawnBigExplosionRatio = EXPLOSIVE_DAWN_BIG_EXPLOSION_RATIO.get().floatValue();
        explosiveDawnSmallExplosionRatio = EXPLOSIVE_DAWN_SMALL_EXPLOSION_RATIO.get().floatValue();
        fireDanceJudgementCutDamage = FIRE_DANCE_JUDGEMENT_CUT_DAMAGE.get().floatValue();
        fireDanceCircleSlashDamage = FIRE_DANCE_CIRCLE_SLASH_DAMAGE.get().floatValue();
        countNightingalesSlash = COUNT_NIGHTINGALES_SLASH.get();
        countSuperBloodCut = COUNT_SUPER_BLOOD_CUT.get();
        countWaveEdgeSuperBase = COUNT_WAVE_EDGE_SUPER_BASE.get();
        costWaveEdgeSuperBoost = COST_WAVE_EDGE_SUPER_BOOST.get();
        waveEdgeSuperDriveDamage = WAVE_EDGE_SUPER_DRIVE_DAMAGE.get().floatValue();
        xrossThunderDamage = XROSS_THUNDER_DAMAGE.get().floatValue();
        fireDanceComboRatio = FIRE_DANCE_COMBO_RATIO.get();
        burningDanceComboRatio = BURNING_DANCE_COMBO_RATIO.get();
        coldDriveComboRatio = COLD_DRIVE_COMBO_RATIO.get();
        sakuraWaveEdgeLeftComboRatio = SAKURA_WAVE_EDGE_LEFT_COMBO_RATIO.get();
        sakuraWaveEdgeRightComboRatio = SAKURA_WAVE_EDGE_RIGHT_COMBO_RATIO.get();
        terrifyingWavesComboRatio = TERRIFYING_WAVES_COMBO_RATIO.get();
        lightingSwordsExComboRatio = LIGHTING_SWORDSEX_COMBO_RATIO.get();
        forLifeComboRatio = FOR_LIFE_COMBO_RATIO.get();
        coldGuardianMaxStack = COLD_GUARDIAN_MAX_STACK.get();
        boostTriggerMaxStack = BOOST_TRIGGER_MAX_STACK.get();
        clearMindCdMaxStack = CLEAR_MIND_CD_MAX_STACK.get();
        blueDreamComboMaxStack = BLUE_DREAM_COMBO_MAX_STACK.get();
        blueDreamChargerMaxStack = BLUE_DREAM_CHARGER_MAX_STACK.get();
        blueDreamChargerSuperMaxStack = BLUE_DREAM_CHARGER_SUPER_MAX_STACK.get();
        forLifeDiveComboRatio = FOR_LIFE_DIVE_COMBO_RATIO.get();
        illusionDriveComboRatio = ILLUSION_DRIVE_COMBO_RATIO.get();
        rainbowDriveComboRatio = RAINBOW_DRIVE_COMBO_RATIO.get();
        waveEdgeSuperComboRatio = WAVE_EDGE_SUPER_COMBO_RATIO.get();
        sakuraDriveLeftComboRatio = SAKURA_DRIVE_LEFT_COMBO_RATIO.get();
        sakuraDriveRightComboRatio = SAKURA_DRIVE_RIGHT_COMBO_RATIO.get();
        xrossThunderComboRatio = XROSS_THUNDER_COMBO_RATIO.get();
        xrossThunder2ComboRatio = XROSS_THUNDER2_COMBO_RATIO.get();
    }
}